@using System
@using ApiGenerator.Domain.Code.HighLevel.Methods
@inherits ApiGenerator.CodeTemplatePage<FluentSyntaxView>
@{
	FluentSyntaxBase syntax = Model.Syntax;
	
	var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName);
	var asyncKeyword = Model.Syntax.InterfaceResponse && Model.Async ? "async " : String.Empty;
	var awaitKeyWord = Model.Syntax.InterfaceResponse && Model.Async ? "await ": string.Empty;
	var configureAwait = Model.Syntax.InterfaceResponse && Model.Async ? ".ConfigureAwait(false)" : String.Empty;
	
	var requestMethodGenerics = syntax.RequestMethodGenerics;
	var descriptor = syntax.DescriptorName;
	var selectorArgs = syntax.SelectorArguments();
	var selectorChained = syntax.SelectorChainedDefaults();
	var cancellationToken = !Model.Async ? string.Empty : ", ct";
}
@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", syntax); }
public @(asyncKeyword)@{ await IncludeAsync("HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml", Model);} @Raw("=>")
	@(awaitKeyWord)@(method)@(Raw(requestMethodGenerics))(selector.InvokeOrDefault(new @(Raw(descriptor))(@Raw(selectorArgs))@(@selectorChained))@cancellationToken)@Raw(configureAwait);
